<?php
if ($_SESSION['login_user']['status'] != 'admin' || LZ_MODULE != 'admin') die('Access Denied');
if($_SESSION['login_user']['status'] != 'admin')
{
	lz_exit(ACCESS_DENIED,'admin.php',1);
}
$m = $_GET['m'];
include_once('model/config.php');
$config = new LZ_Config;
$config_id = intval($_GET['config_id']);

if ($m == 'set')
{
	$name = $_GET['name'];
	$value = $_GET['value'];
	$description = $_GET['description'];
	if ($config->set($name,$value,$description))
	{
		lz_exit(CONFIG_EDIT_SUCCESS,'admin.php?p=config',1);
	}
}
else if ($m == 'delete')
{
	$config->delete($config_id);
	lz_exit(CONFIG_DELETE_SUCCESS,'admin.php?p=config',1);
}

$view_data['config_list'] = $config->get_list();
$view_data['page_description'] = TITLE;
?>